
#ifndef ACCELERATION_CONTROLLER_H
#define ACCELERATION_CONTROLLER_H

// INCLUDES ********************************************************************

#include "Vector2D.h"

#include "Singleton.h"

#include "AccelerationListener.h"

#import <UIKit/UIKit.h>

#include <set>

// FORWARD DECLARATIONS ********************************************************

// *****************************************************************************

//! AccelerationController
//! 
//! Will receive acceleration notifications and delegate them to registered
//! listeners

// *****************************************************************************

namespace Meteor 
{
    class AccelerationController : public Singleton<AccelerationController>
    {
        friend class Singleton<AccelerationController>;
        
        public:
            AccelerationController();
            
            ~AccelerationController();
            
            void AddAccelerationListener( AccelerationListener* listener);
            
            void RemoveAccelerationListener( AccelerationListener* listener);
            
            //! device notification of acceleration
            void DeviceDidAccelerate( const float x, const float y, const float z);
        
        private:
            typedef std::set<AccelerationListener*> containertype;
        
            containertype mListeners;
            
            //! prevent copies
            const AccelerationController& operator=( const AccelerationController&);
        
            AccelerationController( const AccelerationController&);
            
    }; // end of class AccelerationController

} // end of namespace Meteor

#endif

